package com.bys.system.controller;

import com.bys.constant.CrmSystemConstant;
import com.bys.response.Result;
import com.bys.system.model.SysDeptModel;
import com.bys.system.service.ISysDeptService;
import com.bys.system.vo.SysDeptVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 组织机构 前端控制器
 * </p>
 *
 * @author bys
 * @since 2023-03-31
 */@Api(tags = "部门 接口")
@RestController
@RequestMapping("/system/sysDept")
public class SysDeptController {
     @Resource
     private ISysDeptService sysDeptService;
    @ApiOperation(value = "查询所有部门")
     @GetMapping("/findAllDept")
    public Result findAllDept(){
        List<SysDeptVo> data =  sysDeptService.getAllDeptTree(CrmSystemConstant.DEPT_ROOT_ID);
         return Result.success(data);
     }
}
